package com.example.restfullapi.controller;

import cn.soboys.restapispringbootstarter.Result;
import cn.soboys.restapispringbootstarter.ResultPage;
import cn.soboys.restapispringbootstarter.domain.EntityParam;
import cn.soboys.restapispringbootstarter.log.Log;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@RestController
//@RequestMapping("/chat")
public class ChatController {

    @PostMapping("/chat")
    public HashMap chatDialogue() {
        HashMap m = new HashMap();
        m.put("age", 26);
        m.put("name", "Judy");
        return m;
    }

    @PostMapping("/page")
    @Log("分页查询用户数据")
    public Result page(@Validated EntityParam s) {
        ResultPage<List<EntityParam>> resultPage=new ResultPage<>();
        List a=new ArrayList();
        a.add(s);
        resultPage.setPageData(a);
        return ResultPage.buildSuccess(resultPage);
    }
}
